﻿using Server.Business.Player;
using Share.Memory;

namespace Server.Business.EnterGame
{
    public static class EnterGame
    {
        public static void Run(string _socketId, EnterGameReq req, out EnterGameResp resp, out ECode code)
        {
            code = ECode.Success;
            
            resp = new EnterGameResp()
            {
                Uid = req.Uid
            };
            
            PlayerManage.CreatePlayer(resp.Uid);
            PlayerData player = PlayerManage.GetPlayerDataByUid(resp.Uid);
            player.SetWebSocketId(_socketId);
        }
    }   
}